<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation
-->

<!--block IP form -->
<template name="blockIPform">
    <form id="blockIPform" class="form-horizontal" style="margin: 0px 30% 20px;">
        <legend>Block IP</legend>
        <fieldset>
            <!-- IP addr -->
            <div class="control-group">
              <label class="control-label" for="ipaddress">IP address or subnet (IPv6 supported, use addr/X for subnets)</label>
              <div class="controls">
                <input id="ipaddress" name="ipaddress" class="form-control" type="text" required>
              </div>
            </div>
            <!-- Duration -->
            <div class="control-group">
              <label class="control-label" for="duration">Duration</label>
              <div class="controls">
                <select id="duration" name="duration" class="form-control">
                  <option value='1hr' selected>1 hour</option>
                  <option value='12hr'>12 hours</option>
                  <option value='1d'>1 day</option>
                  <option value='2d'>2 days</option>
                  <option value='3d'>3 days</option>
                  <option value='1w'>1 week</option>
                  <option value='30d'>30 days</option>
                </select>
              </div>
            </div>
            <!-- Comment -->
            <div class="control-group">
                <label class="control-label" for="comment">Comment</label>
                <div class="controls">
                    <input id="comment" name="comment" class="input-xlarge" type="text">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="referenceid">Reference ID</label>
                <div class="controls">
                    <input id="referenceid" name="referenceid" class="form-control" type="text" placeholder="optional">
                </div>
            </div>
            <!--plugins-->
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">Plugins:</h3>
                </div>
                <div class="panel-body">
                    {{#each pluginsForEndPoint "blockip"}}

                    <div class="form-group">
                            <div class="col-xs-8 checkbox">
                                <label>
                                    <input type="checkbox"  name="{{name}}">{{name}}: ( {{description}} )
                                </label>
                            </div>
                    </div>
                    {{/each}}
                </div>
            </div>
            <!-- Button -->
            <div class="control-group">
              <label class="control-label" for="submit"></label>
              <div class="controls">
                <button id="submit" type="submit" name="submit" class="btn btn-danger submit">Block!</button>
              </div>
            </div>
        </fieldset>
    </form>
</template>


<template name="blockIPModal">
    <div class="modal fade" id="modalBlockIPWindow">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                   <button type="button" class="close" data-dismiss="modal">&times;</button>
                   <h4>Block IP</h4>
                </div>
                <div class="modal-body">
                    <form id="blockIPform" class="form-horizontal" style="margin: 0px 5%;">
                            <!-- IP addr -->
                            <div class="form-group">
                              <label class="control-label" for="ipaddress">IP address or subnet (IPv6 supported, use addr/X for subnets)</label>
                              <div class="controls">
                                <input id="ipaddress" name="ipaddress" class="form-control" type="text" required>
                              </div>
                            </div>
                            <!-- Duration -->
                            <div class="form-group">
                              <label class="control-label" for="duration">Duration</label>
                              <div class="controls">
                                <select id="duration" name="duration" class="form-control">
                                  <option value='1hr' selected>1 hour</option>
                                  <option value='12hr'>12 hours</option>
                                  <option value='1d'>1 day</option>
                                  <option value='2d'>2 days</option>
                                  <option value='3d'>3 days</option>
                                  <option value='1w'>1 week</option>
                                  <option value='30d'>30 days</option>
                                </select>
                              </div>
                            </div>
                            <!-- Comment -->
                            <div class="form-group">
                                <label class="control-label" for="comment">Comment</label>
                                <div class="controls">
                                    <input id="comment" name="comment" class="form-control" type="text">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="referenceid">Reference ID</label>
                                <div class="controls">
                                    <input id="referenceid" name="referenceid" class="form-control" type="text" placeholder="optional" >
                                </div>
                            </div>

                            <!--plugins-->
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                  <h3 class="panel-title">Plugins:</h3>
                                </div>
                                <div class="panel-body">
                                    {{#each pluginsForEndPoint "blockip"}}

                                    <div class="form-group">
                                            <div class="col-xs-8 checkbox">
                                                <label>
                                                    <input type="checkbox"  name="{{name}}">{{name}}: ( {{description}} )
                                                </label>
                                            </div>
                                    </div>
                                    {{/each}}
                                </div>
                            </div>


                            <!-- Button -->
                            <div class="form-group">
                              <label class="control-label" for="submit"></label>
                              <div class="controls">
                                <button id="submit" type="submit" name="submit" class="btn btn-danger submit">Block!</button>
                              </div>
                            </div>
                    </form>
                </div>
                <div class="modal-footer">
                  <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>
                </div>
            </div>
        </div>
    </div>
</template>
